// SceneTrigger.cs
using UnityEngine;

public class SceneTrigger : MonoBehaviour
{
    public SceneLoader loader;
    /// <summary>
    /// 场景跳转触发
    /// </summary>
    /// <param name="targetScene">目标场景</param>
    /// <param name="useFade">是否渐变</param>
    public void TriggerSceneLoad(GameSceneSO targetScene, bool useFade)
    {
        loader = gameObject.GetComponent<SceneLoader>();
        if (loader == null)
        {
            loader = FindObjectOfType<SceneLoader>();
        }

        
        if (loader) loader.LoadSceneRequest(targetScene, useFade);
    }
}